Remove support for "prepainting" the menu before realizing other than via
authorOwen Taylor <otaylor@redhat.com>
Wed, 12 Dec 2001 21:30:08 +0000 (21:30 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Wed, 12 Dec 2001 21:30:08 +0000 (21:30 +0000)
Wed Dec 12 16:18:26 2001  Owen Taylor  <otaylor@redhat.com>
        * gtk/gtkmenu.c (gtk_menu_realize): Remove support for
        "prepainting" the menu before realizing other than
        via gtk_style_set_background() - this was broken when
        we added menu scroll support.
        * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the
        window in the expose event -- fixes problem with border
        flashing during scrolling.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkmenu.c

index 6e6efdf7aab76eb778d68c18b411307804ac9d34..02f0de5c4b7823cc961354c89dcc022ee8d59e75 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Wed Dec 12 16:18:26 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkmenu.c (gtk_menu_realize): Remove support for
+       "prepainting" the menu before realizing other than
+       via gtk_style_set_background() - this was broken when
+       we added menu scroll support.
+
+       * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the
+       window in the expose event -- fixes problem with border
+       flashing during scrolling.
+
 Wed Dec 12 15:11:49 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtksettings.c (gtk_settings_get_property): Support
index 6e6efdf7aab76eb778d68c18b411307804ac9d34..02f0de5c4b7823cc961354c89dcc022ee8d59e75 100644 (file)
@@ -1,3 +1,14 @@
+Wed Dec 12 16:18:26 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkmenu.c (gtk_menu_realize): Remove support for
+       "prepainting" the menu before realizing other than
+       via gtk_style_set_background() - this was broken when
+       we added menu scroll support.
+
+       * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the
+       window in the expose event -- fixes problem with border
+       flashing during scrolling.
+
 Wed Dec 12 15:11:49 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtksettings.c (gtk_settings_get_property): Support
index 6e6efdf7aab76eb778d68c18b411307804ac9d34..02f0de5c4b7823cc961354c89dcc022ee8d59e75 100644 (file)
@@ -1,3 +1,14 @@
+Wed Dec 12 16:18:26 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkmenu.c (gtk_menu_realize): Remove support for
+       "prepainting" the menu before realizing other than
+       via gtk_style_set_background() - this was broken when
+       we added menu scroll support.
+
+       * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the
+       window in the expose event -- fixes problem with border
+       flashing during scrolling.
+
 Wed Dec 12 15:11:49 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtksettings.c (gtk_settings_get_property): Support
index 6e6efdf7aab76eb778d68c18b411307804ac9d34..02f0de5c4b7823cc961354c89dcc022ee8d59e75 100644 (file)
@@ -1,3 +1,14 @@
+Wed Dec 12 16:18:26 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkmenu.c (gtk_menu_realize): Remove support for
+       "prepainting" the menu before realizing other than
+       via gtk_style_set_background() - this was broken when
+       we added menu scroll support.
+
+       * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the
+       window in the expose event -- fixes problem with border
+       flashing during scrolling.
+
 Wed Dec 12 15:11:49 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtksettings.c (gtk_settings_get_property): Support
index 6e6efdf7aab76eb778d68c18b411307804ac9d34..02f0de5c4b7823cc961354c89dcc022ee8d59e75 100644 (file)
@@ -1,3 +1,14 @@
+Wed Dec 12 16:18:26 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkmenu.c (gtk_menu_realize): Remove support for
+       "prepainting" the menu before realizing other than
+       via gtk_style_set_background() - this was broken when
+       we added menu scroll support.
+
+       * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the
+       window in the expose event -- fixes problem with border
+       flashing during scrolling.
+
 Wed Dec 12 15:11:49 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtksettings.c (gtk_settings_get_property): Support
index 6e6efdf7aab76eb778d68c18b411307804ac9d34..02f0de5c4b7823cc961354c89dcc022ee8d59e75 100644 (file)
@@ -1,3 +1,14 @@
+Wed Dec 12 16:18:26 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkmenu.c (gtk_menu_realize): Remove support for
+       "prepainting" the menu before realizing other than
+       via gtk_style_set_background() - this was broken when
+       we added menu scroll support.
+
+       * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the
+       window in the expose event -- fixes problem with border
+       flashing during scrolling.
+
 Wed Dec 12 15:11:49 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtksettings.c (gtk_settings_get_property): Support
index 6e6efdf7aab76eb778d68c18b411307804ac9d34..02f0de5c4b7823cc961354c89dcc022ee8d59e75 100644 (file)
@@ -1,3 +1,14 @@
+Wed Dec 12 16:18:26 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkmenu.c (gtk_menu_realize): Remove support for
+       "prepainting" the menu before realizing other than
+       via gtk_style_set_background() - this was broken when
+       we added menu scroll support.
+
+       * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the
+       window in the expose event -- fixes problem with border
+       flashing during scrolling.
+
 Wed Dec 12 15:11:49 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtksettings.c (gtk_settings_get_property): Support
index e3940b511a1c2be5e6a021c66faf23b6a5256245..f2b30b99f6dc7a73264cc07b2e2b57815f66722c 100644 (file)
@@ -84,7 +84,8 @@ static void     gtk_menu_size_request      (GtkWidget        *widget,
                                            GtkRequisition   *requisition);
 static void     gtk_menu_size_allocate     (GtkWidget        *widget,
                                            GtkAllocation    *allocation);
-static void     gtk_menu_paint             (GtkWidget        *widget);
+static void     gtk_menu_paint             (GtkWidget        *widget,
+                                           GdkEventExpose   *expose);
 static void     gtk_menu_show              (GtkWidget        *widget);
 static gboolean gtk_menu_expose            (GtkWidget        *widget,
                                            GdkEventExpose   *event);
@@ -1223,8 +1224,6 @@ gtk_menu_realize (GtkWidget *widget)
   gtk_menu_scroll_item_visible (GTK_MENU_SHELL (widget),
                                GTK_MENU_SHELL (widget)->active_menu_item);
 
-  gtk_menu_paint (widget);
-  
   gdk_window_show (menu->bin_window);
   gdk_window_show (menu->view_window);
 }
@@ -1444,20 +1443,22 @@ gtk_menu_size_allocate (GtkWidget     *widget,
 }
 
 static void
-gtk_menu_paint (GtkWidget *widget)
+gtk_menu_paint (GtkWidget      *widget,
+               GdkEventExpose *event)
 {
-  gint border_x;
-  gint border_y;
-  gint width, height;
-  gint menu_height;
-  gint top_pos;
   GtkMenu *menu;
+  gint width, height;
+  gint border_x, border_y;
   
   g_return_if_fail (GTK_IS_MENU (widget));
 
   menu = GTK_MENU (widget);
   
-  if (GTK_WIDGET_DRAWABLE (widget))
+  border_x = GTK_CONTAINER (widget)->border_width + widget->style->xthickness;
+  border_y = GTK_CONTAINER (widget)->border_width + widget->style->ythickness;
+  gdk_window_get_size (widget->window, &width, &height);
+
+  if (event->window == widget->window)
     {
       gtk_paint_box (widget->style,
                     widget->window,
@@ -1465,11 +1466,6 @@ gtk_menu_paint (GtkWidget *widget)
                     GTK_SHADOW_OUT,
                     NULL, widget, "menu",
                     0, 0, -1, -1);
-
-      border_x = GTK_CONTAINER (widget)->border_width + widget->style->xthickness;
-      border_y = GTK_CONTAINER (widget)->border_width + widget->style->ythickness;
-      gdk_window_get_size (widget->window, &width, &height);
-
       if (menu->upper_arrow_visible && !menu->tearoff_active)
        {
          gtk_paint_box (widget->style,
@@ -1523,7 +1519,12 @@ gtk_menu_paint (GtkWidget *widget)
                           MENU_SCROLL_ARROW_HEIGHT - 2 * border_y - 2,
                           MENU_SCROLL_ARROW_HEIGHT - 2 * border_y - 2);
        }
-
+    }
+  else if (event->window == menu->view_window)
+    {
+      gint menu_height;
+      gint top_pos;
+      
       if (menu->scroll_offset < 0)
        gtk_paint_box (widget->style,
                       menu->view_window,
@@ -1559,7 +1560,7 @@ gtk_menu_expose (GtkWidget        *widget,
 
   if (GTK_WIDGET_DRAWABLE (widget))
     {
-      gtk_menu_paint (widget);
+      gtk_menu_paint (widget, event);
       
       (* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
     }